package com.bj58.mis.apm.wf.util;

import java.io.*;
import java.util.Properties;

/**
 * 〈一句话功能简述〉<br> 
 * 〈读取配置文件〉
 *
 * @author zhangyu84
 * @create 2018/7/4
 * @since 1.0.0
 */
public class PropertiesUtil {
    public static String getProperties(String filePath, String keyWord) {
        Properties prop = new Properties();
        String value = null;
        try {
            InputStream inputStream =PropertiesUtil.class.getResourceAsStream(filePath);
            prop.load(inputStream);
            value = prop.getProperty(keyWord);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return value;
    }

    public static void main(String[] args) {
        String key=PropertiesUtil.getProperties("src/main/resources/application.properties", "key");
        System.out.println(key);
    }
}
